package net.zjitc.mapper;

import net.zjitc.pojo.Orderitem;
import net.zjitc.pojo.Orders;
import net.zjitc.vo.OrderConditionVo;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * @AUTHOR zhj
 * @DATE 2019/3/31 13:16
 */
public interface OrderMapper {
   List<Orders> findAllOrder();
   Orders findById(String oid);

   List<Orders> findByCondition(OrderConditionVo vo);

   List<Orderitem> findByOid(String id);

   //查询n天内的所有订单
   List<Orders> findByDayInInterval(String day);

   //根据订单查询订单子项
   List<Orderitem> findItemsByOids(@Param(value = "orders") List<Orders> orders);


    List<Orders> findOrdersByUid(Integer id);

    int  createOrders(Orders orders);

    int createOrderItems(@Param(value = "orderitemList") List<Orderitem> orderitemList);

    int updatePayState(@Param(value = "id") String out_trade_no,
                       @Param(value = "state") Integer state);
}
